package com.xjust.controller.registerDepartMent;

import com.xjust.pojo.Result;
import com.xjust.service.DeptmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/deptments")
public class DeptmentController {
    @Autowired
    DeptmentService deptmentService;
    //获取部门信息
    @GetMapping("/getDeptment")
    public Result getDeptment(){
        List<Map<String, Object>> list = deptmentService.getDeptment();
        return Result.success(list);
    }
    //根据类型查询部门
    @GetMapping("/getDeptmentListBydeptType")
    public Result getDeptmentListBydeptType(String deptType){
        List<Map<String, Object>> list = deptmentService.getDeptmentListBydeptType(deptType);
        return Result.success(list);
    }
}
